﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Windows.Forms;
using CellphoneRepair.DAL;
using CellphoneRepair.Entities;
using DevExpress.XtraEditors;

namespace CellphoneRepair.Forms
{
    public partial class FrmRepairList : DevExpress.XtraEditors.XtraForm
    {
        public FrmRepairList()
        {
            InitializeComponent();
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            gridView1.AddNewRow();
            EditList list = new EditList(repairlistBindingSource);
            list.editType = EnumEditType.Create;
            list.ShowDialog();
        }

        private void simpleButton2_Click(object sender, EventArgs e)
        {
            EditList list = new EditList(repairlistBindingSource);
            list.editType = EnumEditType.Edit;
            list.ShowDialog();
       }

        private void repairlistBindingSource_AddingNew(object sender, AddingNewEventArgs e)
        {
            Repairlist rl = new Repairlist();
            rl.Idlist = Commons.GenerateIdByForeTag("WX");
            e.NewObject = rl;


        }
        
    }
}